import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    //商品详情
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    //发现  
    path: '/discover',
    name: 'discover',
    component: () => import( '../views/Discover.vue')
  },
  {
    //搜索
    path: '/seek',
    name: 'seek',
    component: () => import( '../views/Seek.vue')
  },
  {
    //个人中心
    path: '/personalCenter',
    name: 'personalCenter',
    component: () => import( '../views/PersonalCenter.vue')
  },
  {
    //登录
    path: '/Login',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    //注册
    path: '/Enroll',
    name: 'Enroll',
    component: () => import( '../views/Enroll.vue')
  }
]

const router = new VueRouter({
  routes
})
 
export default router
